package com.eeds.controller.pc;

import com.eeds.base.BaseController;
import com.eeds.common.constant.ParametersConstants;
import com.eeds.common.model.BaseWrapper;
import com.eeds.common.table.UserRoleEntity;
import com.eeds.interceptor.NeedAuth;
import com.eeds.model.role.req.ReqGetRoleInfoListVO;
import com.eeds.service.role.RoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Flying
 * @Description
 * @date 14:16 2018-08-24
 **/
@RestController
@Api(value = "角色接口", description = "角色接口")
@RequestMapping("pc/role/")
public class RoleController extends BaseController {


    @Autowired
    private RoleService roleService;

    /**
     * description:获取角色列表
     * @author: Flying
     * @date: 2018-08-28 12:31
     * @param: null
     * @return
     */
    @RequestMapping(value = "/getRoleInfoList", method = RequestMethod.GET)
    @ApiOperation("获取角色列表")
    @NeedAuth(role = 1)
    public BaseWrapper<List<UserRoleEntity>> getRoleInfoList(ReqGetRoleInfoListVO reqGetRoleInfoListVO){
        List<UserRoleEntity> result = roleService.getRoleInfoList(reqGetRoleInfoListVO);
        return new BaseWrapper<>(result);
    }


}
